function log(category, message, object){
	if ( log.options[category +"_Disabled"] ) return ;

	var log_c_id = category+ "_log";
	var c =  $("#id_frame").append($("<div>",{id:log_c_id , 'class':"log"}))
		.html("tttt");

	$("#id_frame").append($("<div>"))
		.append("test 2222");

	if ( log.options.timestamp)
		message = new Date() + ": " + ( message? message: "");

	var div = $("<div></div>", {'class' : category +"_message"})
		.appendTo(document.body)
//		.attr('class', category +"_message")
		.text(message);
		
/*
var div = $('<div></div') 
   .appendTo(document.body) 
   .attr('property',value) 
   .css({prop:val}) 
   .bind('click',fn); 
	*/
};

var debug;
if ( !debug) debug = {} ;
debug.log = function(thisObj, args) {

	var level = 'info: ';
		// check  log level 
		// 1 : info 2 : warn  3, error 
	if (typeof arguments[1] === 'number') {
		// check less log leven 
		if ( arguments[1] < em.debug.level ) { 
			return;
		}
		
		switch (arguments[1]) {
			case 2 : level = 'Warn: '; break; 
			case 3 : level = 'ERROR: '; break; 
		}
	}	 


	var header = ' : ';

	if(typeof console == "object"){
		if ( typeof thisObj == 'object') {
			
			if ( thisObj.objName ) {
				header = thisObj.objName;
				
			} else if ( typeof thisObj == 'object') {
				header = thisObj.name; //'Object: ';
			}
			else {
				header = ' >> ' + thisObj.toString();
			}
			var params  = [header, level];
			
			var idx;
			for ( idx =1; idx < arguments.length; idx++) {
				params.push (arguments[idx]);
			}
			console.log.apply(console, params);
		} 
	}

};


var retName = function(obj) {
  for (var o in obj) {
  	if ( arguments && arguments.callee && arguments.callee.caller)
    if (arguments.callee.caller===obj[o]) return o;
  }
};


function debug_log (msg) {
	console.log(msg);
};

var localConsole = {

 info: function(caller, msg, args) {
  if ( window.console && window.console.info ) {
   var params = [(this.className) ? this.className : this.toString() + '.' + caller + '(), ' + msg];
   if (args) {
    params = params.concat(args);
   }
   console.info.apply(console, params);
  }
 },

 debug: function(caller, msg, args) {
  if ( window.console && window.console.debug ) {
   var params = [(this.className) ? this.className : this.toString() + '.' + caller + '(), ' + msg];
   if (args) {
    params = params.concat(args);
   }
   console.debug.apply(console, params);
  }
 }
};






log.options = {};
